<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="${pageContext.request.contextPath}/styly.css" type="text/css" rel="stylesheet"/>
        <title><spring:message code="list.title"/></title>
    </head>
    <body>
        <div class="wrapper">
            <div class="header"><h1><spring:message code="list.h1"/></h1></div>
            <div class="navig">
                <%@ include file="../navig.jsp" %>
            </div>    

            <div class="content">
                <h3><spring:message code="list.h3"/></h3>
                <div style="width: 60%;">
                    <table >
                        <tr class="head">
                            <td><b><spring:message code="list.th1"/></b></td>
                            <td><b><spring:message code="list.th2"/></b></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <c:forEach items="${companies}" var="company">
                            <tr>
                                <td><c:out value="${company.name}" /></td>
                                <td><c:out value="${company.adress}" /></td>
                                <td>
                                    <a href="./companyEditJSP/${company.id}"><spring:message code="list.edit"/></a>
                                </td>
                                <td>
                                    <a href="./companyDelete/${company.id}"><spring:message code="list.delete"/></a>
                                </td>
                            </tr>
                        </c:forEach>   
                    </table>      
                    <h4><spring:message code="list.add"/>:</h4>
                    <form method="post" action="companyAdd">
                        <div style="color: red;"><spring:message code="${errMessage1}"/></div>
                        <div style="color: red;"><spring:message code="${errMessage2}"/></div>
                        <b><spring:message code="list.th1"/>:</b> 
                            <input type="text" size="20" name="input1" value="${input1}" /><br/>
                        <b><spring:message code="list.th2"/>:</b>
                            <input type="text" size="30" name="input2" value="${input2}" /><br/>
                        <input type="submit" name="<spring:message code="list.submit"/>" />    
                    </form>
                </div>    
            </div>
            <div class="footer">
                Team: Andrej Hraško, Ondřej Myška, Lukáš Slovák, Michal Polkoráb
            </div>
        </div>
    </body>
</html>
